package org.yohailong.project.common.common.enums;

import org.yohailong.project.common.common.error.BizError;

public enum CommonBizErrorEnum implements BizError {

    SUCCESS("0", "成功"),
    DECODE_ERROR("101", "解密失败"),
    ENCODE_ERROR("102", "加密失败"),
    NEED_LOGIN("200", "用户需要登录"),
    NEED_ADMIN_ROLE("201", "管理员方能操作"),
    PASSWORD_ERROR("202", "密码错误"),
    ACCOUNT_ERROR("203", "账号错误"),
    USER_NOT_EXITS("204", "用户不存在"),
    DATA_EXITS("205", "数据已存在"),
    SAVE_USER_FAILURE("206", "保存用户失败"),
    DELETE_FAILURE("207", "删除失败"),
    SYS_ERROR("208", "系统异常"),
    ;

    private final String errorCode;
    private final String errorMsg;

    CommonBizErrorEnum(String errorCode, String errorMsg) {
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    @Override
    public String errorCode() {
        return errorCode;
    }

    @Override
    public String errorMsg() {
        return errorMsg;
    }
}
